/**
 * replayItem
 * @authors 杨兴洲（of2502）
 * @date    2017/5/27 0027 10:33
 * @version 1.0
 * @last-modify  杨兴洲（of2502）
 */


import {transformURL} from 'util/image';
const getReplyItem = (data) => {
    if (data.type === "text") {
        return data.content;
    }
    if (data.type === "image") {
        return <img src={transformURL(data.url)} alt="content"/>;
    }
    if (data.type === "mpnews") {
        return data.title;
    }
};
const mediaTypes = {
    text: "文本",
    image: "图片",
    mpnews: "图文",
    news: "高级图文",
    video: "视频",
    voice: "语音",
    link: "链接"
};

import React, {Component} from 'react';

export default class FollowReplyItem extends Component {

    static defaultProps = {
        deleteReply: () => void 0,
        editReply: () => void 0
    };

    constructor(props) {
        super(props);
    }

    componentDidMount() {
    }

    render() {
        const {content, type} = this.props;
        return (
            <ul className="reply_list_info">
                <li>
                    <span>【{mediaTypes[type]}】</span>
                    {getReplyItem({content, type})}
                    <a href="javascript:;">删除</a>
                    {type == 'text' ? <a href="javascript:;">编辑</a> : null}
                </li>
            </ul>
        );
    }
}